package cn.bonoon.kernel.io;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;

import cn.bonoon.kernel.util.StringHelper;

public class FileManagerDefinitionParser implements BeanDefinitionParser{
	
	private final static String DEFAULT_ALIAS = "fileManager";
	private final static String DEFAULT_CLASS = StandardFileManager.class.getName();
	
	@Override
	public BeanDefinition parse(Element element, ParserContext parserContext) {
		String alias = element.getAttribute("alias");
		if(StringHelper.isEmpty(alias)){
			alias = DEFAULT_ALIAS;
		}
		String clazz = element.getAttribute("class");
		if(StringHelper.isEmpty(clazz)){
			clazz = DEFAULT_CLASS;
		}
		
		return null;
	}

}
